package framework.graphics;

import javax.microedition.khronos.opengles.GL10;

public class RotatedAnimation extends Animation {

	private float degreesPerSecond;
	private float angle = 0;
	private float rotationCenterX;
	private float rotationCenterY;
	
	public RotatedAnimation(float delay, Texture[] frames, float degreesPerSecond, 
			float rotationCenterX, float rotationCenterY) {
		super(delay, frames);
		this.degreesPerSecond = degreesPerSecond;
		this.rotationCenterX = rotationCenterX;
		this.rotationCenterY = rotationCenterY;
	}
	
	public void draw(float deltaTime, GL10 gl, float x, float y) {
		updateFrames(deltaTime);
		angle += degreesPerSecond * deltaTime;
		frames[currentFrame].draw(gl, x, y, angle, rotationCenterX, rotationCenterY, 1, 1, 0, 0);
	}


}
